<template>
	<view>
		<uni-nav-bar statusBar title="投资金条" :border='false' color="#000" fixed :backgroundColor='backgroundColor'>
			<block slot="left">
				<image class="logo1" src="/static/common/logo1.png" mode=""></image>
			</block>
			<block slot="right">
				<image class="logo1" src="/static/common/logo2.png" mode=""></image>
			</block>
		</uni-nav-bar>
		<image class="BGImage" :src="getImageUrl('/static/common/BG.png')" mode=""></image>
		<view class="" style="position: relative;z-index: 2;">
		<view class="topView">
			<view class="" style="margin: 24rpx;margin-top: 100rpx;" >
				<image src="/static/common/image2.png" mode="widthFix" style="width: 100%;"></image>
			</view>
			<view class="flex-row-space-between flex-wrap" style="margin: 24rpx;" >
				<view v-for="(item,index) in 11" :key="index">
					<view class="itemView">
						<image src="/static/common/5.png" mode="widthFix" style="width: 100%;"></image>
						<view class="name overflow2">
							#福禄寿金条#10g#工艺实心金条#五圣赐...
						</view>
						<view class="price">
							克重：
							<text style="color:#999 ;">约10-109</text>
							
						</view>
						<view class="price">
							工费：
							<text style="color:#E52B3B ;">¥2.50/g</text>
							
						</view>
					</view>
				</view>
			</view>
			<view class="" style="height: 120rpx;">
				
			</view>
		</view>

</view>


	</view>
</template>

<script>
	import {
		mapActions,
		mapState
	} from "vuex";
	import {
		signList,
		driverSignList,
	} from '@/api/index.js'
	export default {
		components: {},
		computed: {

		},
		data() {
			return {
				create_month:'',
				userinfo: {},
				list: [],
				title: "",
				backgroundColor: 'ffffff00',
				list: [],
				data: {}

			}
		},
		computed: {
			...mapState([
				'baseColor'
			]),
		},
		onPageScroll(e) {
			if (e.scrollTop > 20) {
				this.backgroundColor = "#AED0FC"
			} else {
				this.backgroundColor = "#ffffff00"
			}
		},
		onShow() {
			// this.userinfo = uni.getStorageSync('userinfo')
			// this.loadData()
		},
		onLoad(e) {
			// this.create_month=this.getCurrentDate()
		},
		//下拉刷新
		onPullDownRefresh() {


		},
		//加载更多
		onReachBottom() {

		},
		onPageScroll(e) {
			// if (e.scrollTop > 20) {
			// 	this.backgroundColor = "#FBF9FF"
			// } else {
			// 	this.backgroundColor = "#ffffff00"
			// }
		},
		methods: {
			bindDateChange(e){
				console.log(e)
				this.create_month=e.detail.value
				this.loadData()
			},
			getCurrentDate() {
			    const now = new Date();
			    const year = now.getFullYear();
			    const month = String(now.getMonth() + 1).padStart(2, '0'); // 月份从0开始，需要+1
			    const day = String(now.getDate()).padStart(2, '0');
			    
			    return `${year}-${month}`;
			},
			loadData() {

				var data = {
					page: 1,
					page_size: 999,
					create_month:this.create_month
				}
				var url = signList
				if (this.userinfo.group_id == 3) {
					url = driverSignList
				}
				url(data).then(res => {
					this.list = res.data.data
				})
			},


		}
	}
</script>

<style lang="scss">
	.itemView{
		margin-bottom: 24rpx;
	width: 339rpx;
	padding-bottom: 20rpx;
	// height: 500rpx;
	background: #FFFFFF;
	border-radius: 16rpx;
	}
	.name{
		margin:12rpx 24rpx;
		font-weight: 500;
		font-size: 28rpx;
		color: #222222;
	}
	.price{
		margin-left: 24rpx;
		// margin: 24rpx;
		margin-top: 0rpx;
		font-weight: 500;
		font-size: 24rpx;
		color: #333333;
	}
</style>